<?php

require 'orm/om/BaseCityPeer.php';


/**
 * Skeleton subclass for performing query and update operations on the 'city' table.
 *
 * 
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    orm
 */
class CityPeer extends BaseCityPeer {
	
public function getCities($stateId = 1){
		$criteria = new Criteria();

		$criteria->add(CityPeer::STATE_ID, $stateId);

		$oCities = CityPeer::doSelect($criteria);

		foreach($oCities as $city){
			$aCities[$city->getId()] = $city->getName();
		}
		return $aCities;
	}
	public function getCityName($id){

		$oCity = CityPeer::retrieveByPK($id);

		if($oCity)
		{
			return $oCity->getName();
		}else{
			return NULL;
		}
	}
} // CityPeer
